package com.yoyo.itravel.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.sql.SQLException;

/**
 * @Description 景点主题-景点中间表操作持久层接口
 * @Author HZX
 * @Version 1.0
 * @Date 2020/6/22 19:57
 */
@Repository
public interface ISightThemeSightDao {

    /**
     * @Description 插入数据
     *
     * @Param sightId
     * @Param themeId
     * @Return int
     */
    @Insert("insert into middle_tb_sight_theme values(#{sightId},#{themeId})")
    int insert(@Param("sightId") String sightId, @Param("themeId") String themeId) throws SQLException;

    /**
     * @Description 通过景点id和主题id删除景点主题
     *
     * @Param sightId
     * @Param themeId
     * @Return int
     */
    @Delete("delete from middle_tb_sight_theme where sightId=#{sightId} and themeId=#{themeId}")
    int deleteBySightIdAndThemeId(@Param("sightId") String sightId, @Param("themeId") String themeId) throws SQLException;

}
